package com.stillalive.springaop.proxy;

public class HouseProxy implements HouseSubject {
    private HouseSubject realHouseSubject;

    // 代理对象来实现具体操作
    public HouseProxy(HouseSubject realHouseSubject) {
        this.realHouseSubject = realHouseSubject;
    }
    @Override
    public void saleHouse() {
        System.out.println("start proxy");
        realHouseSubject.saleHouse();
        System.out.println("end proxy");
    }
    @Override
    public void rentHouse() {
        System.out.println("start proxy");
        realHouseSubject.rentHouse();
        System.out.println("end proxy");
    }
}
